package gameObject.effect;

import main.Res;
import base.RotatableSprite;
import base.SpriteContainer;

public class ArrowEffect extends BulletEffect{
	
	public ArrowEffect(int id,
			int x,int y,int targetX,int targetY,
			int dam,int speed,int lifeTime) {
		super(new RotatableSprite(Res.IMG_EFFECTS[id], 25, 25, 1),
				x,y,targetX,targetY,5,20,
				dam,speed,lifeTime);
		sprite.setFrameSequence(new int[]{0});
	}
	public int hit(SpriteContainer obj){
		if(!isDetroyed && this.sprite.collidesWith(obj.getSprite(),true))
		{
			isDetroyed = true;
			return damage;
		}
		return 0;
	}
	public boolean isAir(){
		return true;
	}
}
